﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;

namespace ArmyCreator
{
    public partial class LoginView : PhoneApplicationPage
    {
        public LoginView()
        {
            InitializeComponent();

            try
            {
                login.Text = UserContext.Instance.Login;
                password.Password = UserContext.Instance.Password;
            }
            catch (Exception) { }
        }

        private void OnLogin(object sender, EventArgs e)
        {
            UserContext.Instance.Login = login.Text;
            UserContext.Instance.Password = password.Password;
            //MainPage.ViewModel.IsDataLoaded = false;

            NavigationService.GoBack();
        }

        private void OnCancel(object sender, EventArgs e)
        {
            NavigationService.GoBack();
        }
    }
}